package com.zfei.gfb.request;

import com.zfei.gfb.bean.Status;
import com.zfei.gfb.bean.StatusException;
import com.zfei.gfb.util.NewsUtil;

public class NewsArticleRequest {
    private Integer id;

    private Integer paperId;

    private Integer perdId;

    private Integer pageId;

    private Long artDate;

    private String citeTitle;

    private String title;

    private String viceTitle;

    private String keyword;

    private String author;

    private String source;

    private String creator;

    private String nature;

    private String thbPic;

    private Integer status;

    private String ext;

    private Long createTime;

    private String cntime;

    private Long updateTime;

    private String content;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPaperId() {
        return paperId;
    }

    public void setPaperId(Integer paperId) {
        this.paperId = paperId;
    }

    public Integer getPerdId() {
        return perdId;
    }

    public void setPerdId(Integer perdId) {
        this.perdId = perdId;
    }

    public Integer getPageId() {
        return pageId;
    }

    public void setPageId(Integer pageId) {
        this.pageId = pageId;
    }

    public Long getArtDate() {
        return artDate;
    }

    public void setArtDate(Long artDate) {
        this.artDate = artDate;
    }

    public String getCiteTitle() {
        return citeTitle;
    }

    public void setCiteTitle(String citeTitle) {
        this.citeTitle = citeTitle == null ? null : citeTitle.trim();
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getViceTitle() {
        return viceTitle;
    }

    public void setViceTitle(String viceTitle) {
        this.viceTitle = viceTitle == null ? null : viceTitle.trim();
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword == null ? null : keyword.trim();
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author == null ? null : author.trim();
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source == null ? null : source.trim();
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator == null ? null : creator.trim();
    }

    public String getNature() {
        return nature;
    }

    public void setNature(String nature) {
        this.nature = nature == null ? null : nature.trim();
    }

    public String getThbPic() {
        return thbPic;
    }

    public void setThbPic(String thbPic) {
        this.thbPic = thbPic == null ? null : thbPic.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getExt() {
        return ext;
    }

    public void setExt(String ext) {
        this.ext = ext == null ? null : ext.trim();
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public String getCntime() {
        return cntime;
    }

    public void setCntime(String cntime) {
        this.cntime = cntime == null ? null : cntime.trim();
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }


    public void checkInsertNull() {
        if (NewsUtil.anyNull(title, content)) {
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
    }

    public void checkUpdateNull() {
//        checkInsertNull();
        if (id == null) {
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
    }
}